from selenium.webdriver.common.by import By
from pages.base_page import Page


class DashboardPage(Page):

    ele_agents_in_chat = (By.XPATH, u"//span[text()='Agents in Chat']")
    ele_ongoing_chats = (By.XPATH, u"//span[text()='Ongoing Chats']")
    # ele_ongoing_chats_with_Agents = (By.XPATH, u"//span[text()='Ongoing Chats with Agents']")
    # ele_ongoing_chats_with_bot = (By.XPATH, u"//span[text()='Ongoing Chats with Bot']")
    ele_current_queue_length = (By.XPATH, u"//span[text()='Current Queue Length']")
    ele_visitors_on_site = (By.XPATH, u"//span[text()='Visitors on Site']")
    ele_logged_in_agents = (By.XPATH, u"//span[text()='Logged-In Agents']")
    ele_chat_utilization = (By.XPATH, u"//span[text()='Chat Utilization']")

    ele_chats_and_messages_canvas = (By.XPATH, "//canvas")

    ele_get_online_chat = (By.XPATH, u"//p[text()='Get Online & Chat']")
    ele_install_code = (By.XPATH, u"//p[text()='Install Code']")
    ele_add_agens = (By.XPATH, u"//p[text()='Add Agents']")

    # App Download
    ele_windows = (By.XPATH, u"//p[text()='Windows']")
    ele_macos = (By.XPATH, u"//p[text()='MacOS']")
    ele_iphone = (By.XPATH, u"//p[text()='iPhone']")
    ele_ipad = (By.XPATH, u"//p[text()='iPad']")
    ele_android = (By.XPATH, u"//p[text()='Android']")

    # dataTable
    data_table = (By.XPATH, u"//table")

    def __init__(self, driver, url, site_id):
        Page.__init__(self, driver, url)
        self.site_id = site_id
        self.url = url

    def dashboard_eles_check(self):
        self.find_element(*self.ele_agents_in_chat).is_enabled()
        self.find_element(*self.ele_ongoing_chats).is_enabled()
        # self.find_element(*self.ele_ongoing_chats_with_Agents).is_enabled()
        # self.find_element(*self.ele_ongoing_chats_with_bot).is_enabled()
        self.find_element(*self.ele_current_queue_length).is_enabled()
        self.find_element(*self.ele_visitors_on_site).is_enabled()
        self.find_element(*self.ele_logged_in_agents).is_enabled()
        self.find_element(*self.ele_chat_utilization).is_enabled()
        self.find_element(*self.ele_chats_and_messages_canvas).is_enabled()
        self.find_element(*self.ele_get_online_chat).is_enabled()
        self.find_element(*self.ele_install_code).is_enabled()
        self.find_element(*self.ele_add_agens).is_enabled()
        self.find_element(*self.ele_windows).is_enabled()
        self.find_element(*self.ele_macos).is_enabled()
        self.find_element(*self.ele_iphone).is_enabled()
        self.find_element(*self.ele_ipad).is_enabled()
        self.find_element(*self.ele_android).is_enabled()



